import request from '@/config/axios'
import type {
  AnalysisTotalTypes,
  WeeklyUserActivity,
  OrderDataTrendStatisticsParams
} from './types'

export const getCountApi = (): Promise<IResponse<AnalysisTotalTypes[]>> => {
  return request.get({ url: '/analysis/total' })
}

export const getWeeklyUserActivityApi = (): Promise<IResponse<WeeklyUserActivity[]>> => {
  return request.get({ url: '/analysis/weeklyUserActivity' })
}

export const getDataStatisticsApi = () => {
  return request.get({ url: '/index/dataStatistics' })
}

export const getOrderDataTrendStatisticsApi = (params: OrderDataTrendStatisticsParams) => {
  return request.get({ url: '/index/orderDataTrendStatistics', params })
}

export const getActiveDataTrendStatisticsApi = (params: OrderDataTrendStatisticsParams) => {
  return request.get({ url: '/index/activeDataTrendStatistics', params })
}

export const getToDoDataStatisticsApi = () => {
  return request.get({ url: '/index/toDoDataStatistics' })
}
